Subject: Transport Connection management.

From: [email-masked] (Scott Adams)
Date: Tue, 10 Aug 1993 16:24:19 -0400 (EDT)

My apologies for neglecting to put the actual proposal into my
previous mail message...

Here's my proposal for managing Transport Connections.  I believe it
is compatible with RFC 1434, as I understand it to work.  It also
provides for optional management mechanisms via capabilities (what do
those in the capabilities workgroup think of the capabilities-related
part?).  Let me know what you think...

Scott



             DLS Transport Management (Tunnel) State Transitions

                  +--------------------------------------------------------+
                  |                                                        |
                 \|/             +------------------+                      |
                  +--------------+   DISCONNECT (1) |                      |
                  |              +-+-------------+--+                      |
                  | Acpt Cnxn     /|\            |                         |
                  |   (2)          | Cnxn        | Connect Req             |
                 \|/               | Error/     \|/  (3)                   |
           +------+-----+          | Reset +-----+--------+                |
           | CONTACTED  +--------->+<------+ CONTACT PEND |                |
           +------+-----+         /|\      +-+-------+----+                |
      Connect Req |                |         |       | Connected           |
                  +<-------------------------+       |                     |
             (4) \|/               |  Accept Cnxn   \|/                    |
           +------+------+         |            +----+----+                |
           | PAIRED PEND +-------->+<-----------+ CONTACT |                |
           +------+------+        /|\           +----+----+                |
                  | Connected      |                 |                     |
                  +<---------------------------------+                     |
             (5) \|/               |      Accept Cnxn                      |
           +------+-----+ Rcv Cap  |                                       |
           |   PAIRED   +----+     |                                       |
           +------+-----+    |     |                                       |
                  |  Snd     |     |                                       |
                  |  Capab   |     |                                       |
                 \|/         |     |                                       |
           +------+-------+  |     |                                       |
      (6)  | CAPABLE PEND +------->+                                       |
           +--+---+---+---+  |    /|\                                      |
     Cmplete  +<--+<--+<-----+     |            (9)                        |
     Capab    |   |   |  Dynamic   |      +--------------+                 |
              |   |   +------------|----->+ DYNDISCONNECT+<-----------+    |
              |   |   Full Duplx   |      +-+----+-----+-+            |    |
        (7)   |   +----------+     |   Acpt |   /|\    | Cnct    Cnxn |    |
    RFC 1434 \|/             |     |   Cnx  |    |Cnxn | Req     Err  |    |
         +------+-------+    |     |        |    |End \|/             |    |
         | HD CONNECTED +--------->+        |    | +---+--------+     |    |
         +--------------+    |    /|\       |    | | DYNCNXN PND+---->+    |
                            \|/    |        |    | +---+--------+    /|\   |
                      +------+-----+-+      |    |     | Cncntd       |    |
                (8)   + FD CONNECTED |     \|/   |    \|/        (11) |    |
                      +------+-------+    +-+----+-----+-+            |    |
                             |        (10)| DYN CONNECT  +------------+    |
                             |            +------+-------+                 |
                             |                   |   Cnxn Ind (Rset/Rboot) |
                             +------------------>+-------------------------+
     Notes
     -----

1.   This state diagram only applies to the DLS Tunneling connection
     between a single pair of Data Link Switches (DLSw).  This is the
     state immediately after initialization and a Listen has been
     issued on the Well-known port 2065.

2.   A Connect issued by remote DLSw (to our local port 2065, from
     it's port 2067).  Alloc data struct for Tunnel, accept cnxn.

3.   If the DLSw has partners configured, it must alloc a data struct
     and attempt a connection to each one to which it doesn't already
     have such a struct and connection.  Note that this required a
     periodic effort to contact those with whom not already paired.


4.   Initiating a connection to a partner DLSw requires two events and
     an additional state, while accepting a connection is a single
     event.
     
5.   Once both TP connections are made we are paired.  This is the
     point where RFC 1434 considers the DLS "tunnel" to be
     established.

6.   Some criteria must be used for determination of which DLSw
     initiates capabilities exchange.  Smaller of IP addr (as 32 bit
     word) initiates.  Final "UP" state is one of three possible
     connected states (two are TP management options).

7.   HD CONNECTED is Half-Duplex Connected, which is described in the
     DLS RFC (1434).  Two static TCP cnxns are maintained between each
     pair, and used only in a half-duplex manner.

8.   FD CONNECTED is Full-Duplex Connected, which is a proposed (here)
     new option that would drop one of the two static TCP connections
     (in favor of the one initiated by the DLSw with the smaller IP
     addr, as described for capabilities).  Otherwise it is similar to
     HD CONNECTED.

9.   DYNDISCONNECT is a second proposed option, where both static TCP
     cnxns are disconnected (if there are no established Data Links),
     but the Tunnel data structs are kept.  In this state a single TCP
     cnxn is established as-needed (ie: a DLSw receives a local
     source-route UI pkt, or a SABME for a dest addr previously known
     to be on the partner DLSw), and which lasts only as long as
     needed (last DISC on a Data Link would trigger disconnect).
     Dynamic Tunnel cnxns are listened for on 2067, while new DLSw
     partners are accepted on port 2065 as before.

10.  A connect from a DLSw partner using this TP mgt option, or a
     local packet that requires a Data Link to a partner, will result
     in the establishment of a Tunnel and a move to this state.  Once
     the Tunnel is "UP" it is used just as in RFC 1434.

11.  With the Dynamic TP Mgt option a TP Connection Error results in a
     return to the DYNDISCONNECT state rather than DISCONNECT as is
     the case for all other TP Mgt options.


                   State Tables for TP Management

DISCONNECT: (1)
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|  Config'd Partner  | TCP Connect Req    |  CONTACT PEND          |
+--------------------+--------------------+------------------------+
|  Connect Indicat   | Accept Cnxn        |  CONTACTED             |
+--------------------+--------------------+------------------------+
  
Notes:
(1)  Before entering DISCONNECT state must have completed
     initialization, including list of DLSw partners, and have issued
     a Listen on TCP port 2065, the Well-known DLS port.

CONTACT PEND:
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|  Connect Complete  | Strt 2nd hlf timr  |  CONTACT               |
+--------------------+--------------------+------------------------+
|  Connect Indicat   | Accept Cnxn        |  PAIRED PEND           |
+--------------------+--------------------+------------------------+
|  Connect Error     | Disc TP cnxns      |  DISCONNECT            |
+--------------------+--------------------+------------------------+

CONTACT:
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|  Connect Indicat   | Accept Cnxn        |  PAIRED                |
|                    | Clr 2nd hlf timr   |                        |
+--------------------+--------------------+------------------------+
|  2nd hlf timr expr | Discnct own half   |  DISCONNECT            |
+--------------------+--------------------+------------------------+
|  Connect Error     | Disc TP cnxns      |  DISCONNECT            |
+--------------------+--------------------+------------------------+

CONTACTED:
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|                    | TCP Connect Req    |  PAIRED PEND           |
+--------------------+--------------------+------------------------+
|  Connect Error     | Disc TP cnxns      |  DISCONNECT            |
+--------------------+--------------------+------------------------+

PAIRED PEND:
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|  Connect Confirm   |                    |  PAIRED                |
+--------------------+--------------------+------------------------+
|  Connect Error     | Disc TP cnxns      |  DISCONNECT            |
+--------------------+--------------------+------------------------+


PAIRED:
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|  IP addr < Partnr  | Snd Capab Pkt      |  CAPABLE PEND          |
|                    | Strt Capab Timr    |                        |
+--------------------+--------------------+------------------------+
|  Rcv Capab Pkt     | Snd Ack w/ match   |  HD CONNECTED          |
|                    |                    +------------------------+
|                    |                    |  FD CONNECTED          |
|                    |                    +------------------------+
|                    |                    |  DYNDISCONNECT         |
+--------------------+--------------------+------------------------+
|  Connect Error     | Disc TP cnxns      |  DISCONNECT            |
+--------------------+--------------------+------------------------+

CAPABLE PEND:
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|  Rcv Capab Ack     | Clr Capab Timr     |  HD CONNECTED          |
|                    | Match TP mgt capab +------------------------+
|                    |                    |  FD CONNECTED          |
|                    |                    +------------------------+
|                    |                    |  DYNDISCONNECT         |
+--------------------+--------------------+------------------------+
|  Capab Timr Exp(1) |                    |  HD CONNECTED          |
+--------------------+--------------------+------------------------+
|  Connect Error     | Disc TP cnxns      |  DISCONNECT            |
+--------------------+--------------------+------------------------+

(1)  This timer must be longer than TCP time-out period (ie: > 2 min
     typical) to detect cnxn error properly.

HD CONNECTED:
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|  Connect Error (1) | Disc TP cnxns      |  DISCONNECT            |
+--------------------+--------------------+------------------------+

(1)  This will automatically handle case where partner reboots.  Its
     attempt to re-connect will cause TCP Reset, generate local error
     on cnxn (local port 2065), and force discon and to DISCONNECT
     state.

FD CONNECTED:
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|  Connect Error (1) | Disc TP cnxns      |  DISCONNECT            |
+--------------------+--------------------+------------------------+
|  Connect Indicat(2)| Accept Cnxn        |  CONTACTED             |
|                    | Disc prev TP & clr |                        |
+--------------------+--------------------+------------------------+

(1)  This will automatically handle case when local port is 2065 (local
     IP addr > partner IP addr) and partner reboots.  Its attempt to
     re-connect (on local port 2065) will cause TCP Reset, generate
     local error on cnxn (local port 2065), and force discon and to
     DISCONNECT state.

(2)  This is other case, when local port is 2067.  New Connect
     Indication on 2065 from established partner indicates
     reset/reboot, so disconn on old cnxn and go to CONTACTED state.


DYNDISCONNECT:
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|  Connect Indicat(1)| Accept Cnxn        |  DYN CONNECT           |
+--------------------+--------------------+------------------------+
|  local pkt to link | Connect Req        |  DYNCNXN PND           |
+--------------------+--------------------+------------------------+
|  Connect Error     | Disc TP cnxns      |  DYNDISCONNECT (2)     |
+--------------------+--------------------+------------------------+
|  Connect Indicat(3)| Accept Cnxn        |  CONTACTED             |
|                    | Disc prev TP & clr |                        |
+--------------------+--------------------+------------------------+

(1)  In dynamic TP mgt will listen for Dynamic cnxns on port 2067.

(2)  Once using dynamic TP mgt, don't go back to DISCONNECT state
     unless explicit reset or reboot occurs.

(3)  If a new Connect Indication on 2065 from established partner, then
     indicates reset/reboot, so disconn on old cnxn and go to
     CONTACTED state.

DYNCNXN PND:
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|  Connect Indicat   | Accept Cnxn        |  DYN CONNECT           |
+--------------------+--------------------+------------------------+
|  Connect Error     | Disc TP cnxns      |  DYNDISCONNECT         |
+--------------------+--------------------+------------------------+
|  Connect Indicat   | Accept Cnxn        |  CONTACTED             |
|  Rst/Rboot         | Disc prev TP & clr |                        |
+--------------------+--------------------+------------------------+

DYN CONNECT:
+--------------------+--------------------+------------------------+
|       Event        |      Actions       |      Next State        |
+====================+====================+========================+
|  local disc req    | TP Disc            |  DYNDISCONNECT         |
+--------------------+--------------------+------------------------+
|  Disc indication   |                    |  DYNDISCONNECT         |
+--------------------+--------------------+------------------------+
|  Connect Error     |                    |  DYNDISCONNECT         |
+--------------------+--------------------+------------------------+
|  Connect Indicat   | Accept Cnxn        |  CONTACTED             |
|  Rst/Rboot         | Disc prev TP & clr |                        |
+--------------------+--------------------+------------------------+